package cn.myj2c.executor.providers;


import cn.myj2c.executor.values.JavaValue;
import cn.myj2c.executor.Context;
import org.objectweb.asm.Type;

public abstract class MethodProvider implements Provider {

    @Override
    public boolean canGetField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Context context) {
        return false;
    }

    @Override
    public boolean canCheckcast(JavaValue target, Type type, Context context) {
        return false;
    }

    @Override
    public boolean canSetField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Object value, Context context) {
        return false;
    }

    @Override
    public boolean canCheckInstanceOf(JavaValue target, Type type, Context context) {
        return false;
    }

    @Override
    public boolean canCheckEquality(JavaValue first, JavaValue second, Context context) {
        return false;
    }

    @Override
    public void setField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Object value, Context context) {
        throw new IllegalStateException("Cannot set field on MethodProvider");
    }

    @Override
    public Object getField(String className, String fieldName, String fieldDesc, JavaValue targetObject, Context context) {
        throw new IllegalStateException("Cannot get field on MethodProvider");
    }

    @Override
    public boolean instanceOf(JavaValue target, Type type, Context context) {
        throw new IllegalStateException("Cannot check instanceof on MethodProvider");
    }

    @Override
    public boolean checkEquality(JavaValue first, JavaValue second, Context context) {
        throw new IllegalStateException("Cannot check equality on MethodProvider");
    }

    @Override
    public boolean checkcast(JavaValue target, Type type, Context context) {
        throw new IllegalStateException("Cannot check cast on MethodProvider");
    }
}
